package digital_cash_system;

import java.math.BigInteger;
import java.security.SecureRandom;

public class Utils
{
	final static SecureRandom secureRandom = new SecureRandom();

	public static BigInteger generateZ_qMember(BigInteger q)
	{
		BigInteger z_qMember;
		do
		{
			z_qMember = new BigInteger(q.bitLength(), secureRandom);
		} while (z_qMember.compareTo(q.subtract(BigInteger.ONE)) == 1
				|| z_qMember.equals(BigInteger.ZERO));

		return z_qMember;
	}
}
